<template>
  <div class="container" :style="'background:rgba(255,255,255,'+transition+')'">
    <div class="search">
      <input type="text" placeholder="快速搜索你想要的内容" placeholder-class="placeholder-style">
      <icon type="search" size=14px></icon>
    </div>
    <div class="fenlei">
      <img src="../images/hamburger.png" mode="aspectFit">
      <p>分类</p>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      transition: 0
    };
  },
  onPageScroll: function(e) {
    this.transition = e.scrollTop / 400;
    // console.log(this.transition)
  }
};
</script>

<style>
.placeholder-style {
  color: #7f7f7f;
  font-size: 12px;
  -webkit-text-align: center;
  text-align: center;
  line-height: normal;
}

</style>

<style lang="scss" scoped>
.container {
  box-sizing: border-box;
  position: fixed;
  top: 150rpx;
  left: 0;
  width: 750rpx;
  padding: 0 25rpx;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  .search {
    position: relative;
    padding:10rpx 0;
    input {
      height: 60rpx;
      background: #f8f8f8;
      border-radius: 30rpx;
      padding: 0 60rpx;
      font-size: 14px;
      width: 510rpx;
    }
    icon {
      position: absolute;
      left: 160rpx;
      top: 26rpx;
    }
  }
  .fenlei {
    margin-top: 20rpx;
    height: 50rpx;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    img {
      width: 40rpx;
      height: 24rpx;
    }
    p {
      color: #6e6e6e;
      font-size: 10px;
    }
  }
}
</style>
